import Vue from 'vue'
const state = {
  linkParams:"",
  scheduleParams:{}
};

const mutations = {
  SET_LINKPARAMS: (state, params) => {
    state.linkParams = params
  },
  SET_SCHEDULEPARAMS: (state, params) => {
    state.scheduleParams = params
  },
};

const actions = {
  toWorkList({ commit }, data){
    return new Promise((resolve, reject)=> {
      commit("SET_LINKPARAMS", data);
      resolve()
    }).catch(()=>{
      reject()
    });
  },
  getDetailInfoById({ state,commit }, data){
    return new Promise((resolve, reject)=> {
      let id = state.linkParams.documentId
      commit("SET_LINKPARAMS", {});
      resolve({id:id})
    }).catch(()=>{
      reject()
    });
  },
  saveScheduleParams({ state,commit }, data){
    return new Promise((resolve, reject)=> {
      commit("SET_SCHEDULEPARAMS", data);
      resolve()
    }).catch(()=>{
      reject()
    });
  },
};
export default {
  namespaced: true,
  state,
  mutations,
  actions
};
